AppleScript (Mac)

AppleScript is an English-like language used to write script files that automate the actions of your computer and the applications that run on it. Apple's Script Editor comes with Mac OS X and contains everything you need to start automating tasks with AppleScript.

For more information about AppleScript, see http://www.macosxautomation.com/applescript/.

Apple's Script Editor includes a Standard Suite of classes and commands that work for most applications, including EndNote. The Standard Suite includes basic commands such as open, save, and close. Script Editor also includes a Text Suite of basic classes for text processing. In addition, the following EndNote commands and classes are available as part of EndNote Services Scripting. All commands are accessible in the Script Editor application, from the Open Dictionaries command.

Check out these AppleScript examples for ideas.

EndNote Reference Scripting

create record v: Create a new record with optional contents

create record

in reference : the document in which to create the record.
with
Unicode text : Contents of the record as XML string
Unicode text

delete record v: Delete the record(s) with specified ID(s)

delete record list : single Record ID, or list of record IDs

export v: Export a list of records with specified format

export list : single Record ID, or list of record IDs

as Unicode text : Specifier of format to export. (Currently RSXML is the only supported format.)

Unicode text

field v: Returns the contents of the specified field of the specified record

fields Unicode text : field name

of record Unicode text : Record ID

Unicode text

fields of v: Get a list of names of fields of the specified record.

fields of Unicode text : Record ID

anything

find v : Find records containing the specified text

find Unicode text : text to find in records of open libraries

[constrain to Unicode text] : Only return results if they match the constraint specifier. One of: all, selected, highlighted, shown hidden. If omitted all is used

[in field Unicode text] : name of field to search in each record (if omitted all fields are searched)

anything

format bibliography v : Create a formatted bibliography with a list of records

format bibliography Unicode text : List of records to format

[to alias] : optional:file path (if omitted, results will be placed on pasteboard and can be pasted in other applications)
[with Unicode text] : optional: output style (if omitted, default style chosen in EndNote application will be used instead)

format manuscript v : Takes a manuscript spec and generates a formatted bibliography in RTF

format manuscript Unicode text : manuscript specification in XML format (see help, and additional documentation for details.)

get groups v : Get the list of groups in the specified Library window.

get groups

in reference : specifier of Library window displaying the groups

[containing Unicode text] : Record ID contained in groups

[of type Unicode text] : type of group [ALL, AUTOMATIC, SMART, or CUSTOM are allowed at this time) if omitted ALL is used

anything

get records in v : Get the list of records in a specified group in the library window.

get records in Unicode text : name of group

in reference : specifier of Library window to which group should be posted

[of type Unicode text] : type of group [ALL, AUTOMATIC, SMART, or CUSTOM are allowed

at this time) if omitted ALL is used

anything

highlight records v : Highlight records in a document window.

highlight records in list: single Record ID, or list of record IDs

 In reference : specifier of Library window in which records should be highlighed

import v : Import records into a document.

import list : RSXML representation of records to be imported as unicode string.

into reference : specifier of document into which records should be imported

post records in v : Post the specified list of records as a group in the library window.

post records in list : single Record ID, or list of record IDs

in reference : specifier of Library window to which group should be posted

[as Unicode text] : name of group (if omitted AppleScript Group is used)

[of type Unicode text] : type of group (AUTOMATIC or CUSTOM are allowed at this time) if omitted SYSTEM is used

record contents v: Get the content of the record formatted as XML

read contents list : single Record ID, or list of record IDs

retrieve v: Get a list of records

retrieve Unicode text : specifier to identify which records should be retrieved. One of: all, selected, highlighted, shown, hidden

records in reference : Document to retrieve record from

anything

set field v: Sets the contents of the specified field of the specified record to the specified text value.

set field Unicode text : Field name

of record Unicode text : Record ID

to Unicode text : text value

set record contents v: Update the record or create new record with specified contents

set record contents Unicode text : contents of record formatted as XML

with ID Unicode text : Record ID as unicode string

show records in v : Show only the specified list of records in the Library window.

show record in list : single Record ID, or list of record IDs

in reference : specifier of Library window in which records should be displayed

unformatted record v : Get the unformatted citation of the specified record

unformatted record list : single Record ID, or list of record IDs

Unicode text

application n [see the  AppleScript Standard Suite] : The application's top-level scripting object.

Elements: contains documents, windows.

Properties:

frontmost (boolean, r/o) : Is this the frontmost (active) application?

name (Unicode text, r/o) : The name of the application

output styles (Unicode text) : The list of available output styles

version (Unicode text, r/o) : The version of the application

EndNote Technical Scripting

format manuscript v : Takes a manuscript spec and generates a formatted bibliography in RTF

format manuscript Unicode text : manuscript specification in XML format (see help, and additional documentation for details.)

perform query v : Run XML formatted EndNote query on all documents or specified document

perform query Unicode text :  EndNote query formatted as XML

[on reference] : specifier of document on which the query will be performed

anything

RTF record v : Get the specified record formatted with output style

RTF record list : single Record ID, or list of record IDs

Unicode text

Note: EndNote Technical Scripting commands and classes are intended for advanced scripting. Some C++/Obj-C programming may be required to use these commands.

Related Topics

EndNote Preferences

Shortcut Menus

Shortcuts to Make Using EndNote Easier

Toolbars